This invention relates to packet-based data communication networks such as for example Ethernet networks and more particularly relates to the organisation and management of traffic queues in network switches.
It is customary, and in most circumstance a practical necessity, for network switches, that is to say devices having a multiplicity of ports for receiving data packets and arranged to forward data packets from one or more ports, to provide some temporary storage of packets in a queue for each xe2x80x9ctransmittingxe2x80x9d port. It should be understood that switches commonly have ports which are capable of duplex operation and the term xe2x80x9ctransmitting portxe2x80x9d is intended to refer to the transmit function of a port which is capable of duplex operation.
It is desirable for a variety of reasons to sort traffic data into different types, that is to say high priority and low priority or normal loss and low loss packets. It is inevitable in a practical system that a network or part of it may become congested and in order to relieve that congestion it may be necessary to discard packets rather than to store and forward them normally. The criteria for discard may vary according to the sorting which is desired. For example, network switches may be remote or internally controlled by means of special packets known as xe2x80x9cmanagement framesxe2x80x9d which may normally be given a high priority, and thereby immunity against discard. Alternatively, certain packets (for example those defining video data) must be transmitted with a minimum or constant latency. As a practical matter it is better to discard such packets rather than to transmit them with excessive delay, since many television systems are capable of reconstituting (by extrapolation or interpolation) missing video data whereas cannot properly handle data which is received out of proper synchronism.
It is in theory possible to provide for each transmitting port of a switch a multiplicity of queues of packets sorted according to traffic type, but such an expedient has a disadvantage of adding more memory in respect of each port. Such a solution is particularly undesirable where traffic queues are implemented within an ASIC (application specific integrated circuit) rather than external memory. Furthermore, adding memory to a port does not scale easily if there are for example four queues per port.
The basis of the present invention is to employ for at least one port, and optionally in respect of a multiplicity of ports, a FIFO queue which can support at least two categories of traffic sorted according to traffic type, such as low and normal loss. The terms xe2x80x98low lossxe2x80x99 and xe2x80x98normal lossxe2x80x99 are used herein to denote packets of which xe2x80x98normal lossxe2x80x99 packets should be discarded in preference to low loss packets. The invention further contemplates use of a threshold or xe2x80x9cwatermarkxe2x80x9d and a packet ratio counter which counts the ratio of the aggregate sizes of the respective traffic types, for example in bytes. Thus the FIFO queue can accept both low and normal loss packets up to the threshold or watermark, which is preferably programmable. Accordingly, in an uncongested system, no packet will be lost.
Once the length of FIFO queue exceeds the threshold, the system enables a decision to be made whether to accept or discard a packet. A counter (or a set of counters) may be used to form a net aggregate of the accumulated traffic flow of one type and a scaled traffic flow of the other type, the scaling being made in accordance with the desired ratio. The counter may be incremented by the size of every accepted packet of one type and decremented by a scaled packet size of another type. The net aggregate is used to make a decision whether to accept or discard a packet of said other type. In particular, a scaled packet may be compared with said net aggregate and be discarded or transmitted according as the scaled packet size is greater than said net aggregate or not.
These and further features of the invention will be more apparent from the following description by way of example and with reference to the accompanying drawings.